//
//  Untitled.swift
//  hello
//
//  Created by yafei li on 2025/9/16.
//
import Vapor
// 通用提示
extension HTTPResponseStatus {
    //  Token已失效
    static var tokenInvalid: HTTPResponseStatus {
        .custom(code: 10001, reasonPhrase: "Token已失效")
    }
    /// 操作失败
    static var operationFailed: HTTPResponseStatus {
        .custom(code: 10002, reasonPhrase: "操作失败")
    }
    /// 请求参数错误
    static var requestParametersError: HTTPResponseStatus {
        .custom(code: 10003, reasonPhrase: "请求参数错误")
    }
    
    
}
extension Abort{
    static var tokenInvalid: Abort {
        return Abort(.tokenInvalid,reason: "Token已失效")
    }
    static var operationFailed: Abort {
        return Abort(.operationFailed,reason: "操作失败")
    }
    static var requestParametersError: Abort {
        return Abort(.requestParametersError,reason: "请求参数错误")
    }
}






